package jdk8的特性.使用流来收集数据.复杂分组;

import java.util.ArrayList;
import java.util.List;

/**
 * @author idea
 * @data 2018/9/16
 */
public class MockFoodList {

    public static List<Food> mockFoodList(){
        List<Food> foods=new ArrayList<>();
        for(int i=1;i<=3;i++){
            Food food=new Food();
            food.setName("food1"+i);
            food.setType("肉类");
            food.setCaloricLevel(i*100);
            foods.add(food);
        }
        for(int i=4;i<=6;i++){
            Food food=new Food();
            food.setName("food1"+i);
            food.setType("蔬菜");
            food.setCaloricLevel(i*100);
            foods.add(food);
        }
        for(int i=7;i<=9;i++){
            Food food=new Food();
            food.setName("food1"+i);
            food.setType("水果");
            food.setCaloricLevel(i*100);
            foods.add(food);
        }

        return foods;
    }
}
